package com.test.str;

import com.google.common.base.Strings;
import org.apache.commons.lang3.StringUtils;

import java.math.BigDecimal;
import java.util.Arrays;
import java.util.Objects;

public class StringFormatDemo {

    public static void main(String[] args) throws Exception {
        String s = "车辆：%s，车牌号：%s，订单编号：%s，已经成功下单，请及时查看。【枫叶租车】";

        System.out.println(String.format(s, 1, 2, 3));

        System.out.println(Strings.lenientFormat("%s, %s", 1, 2));

        String ss = "1,2,3,4,5";
        System.out.println(Arrays.asList(ss.split(",")));
        System.out.println(Arrays.asList(s.split(",")));

        System.out.println(Objects.equals(s, null));

        Integer o = 0;
        System.out.println(Objects.equals(o, 0));


//        List<String> strList = new ArrayList<>();
//
//        for (int i = 0; i < 100; i++) {
//            strList.add("TEST_" + i);
//        }
//
//        strList.stream().filter(ts -> !ts.isEmpty()).forEach(sss -> {
//            try {
//                Thread.sleep(2 * 1000);
//            } catch (InterruptedException e) {
//                e.printStackTrace();
//            }
//            System.out.println(sss);
//        });
        BigDecimal a = new BigDecimal("10000");
        BigDecimal b = new BigDecimal("800000");
        System.out.println(a.divide(b));

        System.out.println(" ========================================================== t ================================================");

        String[] strs = new String[]{"111", "222", "333", "444", "555", "666"};
        System.out.println(StringUtils.join(strs));

    }
}
